/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.yandex.skipasssystem.skipass;

import java.util.Date;

/**
 *
 * @author Mitya
 */
public class DayOffSkiPassUnlimited extends AbstractSkiPass implements DayOff {

    
    DayOffSkiPassUnlimited(Date activationDate, DurationOfRides duration) {

        this.activationDate = activationDate;
        this.expirationDate = new Date(activationDate.getTime() 
                + duration.getHours() * DurationOfRides.HOUR);        
        this.type = SkiPassType.DAY_OFF_UNLIMITED;
    }

    @Override
    public boolean isValid() {

        if (isBlocked()) {
            return false;
        }

        if (isExpired()) {
            System.out.println("Expired");
            return false;
        }

        if (!isWeekend()) {
            return false;
        }
        return true;
    }

    @Override
    public SkiPassType getType() {
        return this.type;
    }

}
